package com.jgp.sys.model;

import com.jgp.common.persistence.TreeModel;
import com.jgp.common.pojo.TreeBean;

import javax.persistence.*;

/**
 * 项目   sys
 * 作者   loufei
 * 时间   2018/2/26
 */
@Entity
@Table(name = "sys_dd_attribute")
public class DdAttribute extends TreeModel {
    
    private static final long serialVersionUID = 4466356720996660047L;
    //属性类型
    @Column(name = "type",length = 20)
    @Enumerated(EnumType.STRING)
    private AttributeType type;

    //属性类型
    @Column(name = "func_type",length = 50)
    @Enumerated(EnumType.STRING)
    private FunctionType funcType;

    //用于标识一组数据
    @Column(name = "active_key",length = 100)
    private String activeKey;
    //值
    @Column(name = "value",length = 100)
    private String value;
    //扩展属性1
    @Column(name = "ext_1",length = 100)
    private String ext1;
    //扩展属性2
    @Column(name = "ext_2",length = 100)
    private String ext2;
    //扩展属性3
    @Column(name = "ext_3",length = 100)
    private String ext3;

    //标题
    @Column(name = "label",length = 100)
    private String label;
    //排序
    @Column(name = "sort",length = 3)
    private Integer sort;
    
    public AttributeType getType() {
        return type;
    }

    public void setType(AttributeType type) {
        this.type = type;
    }

    public FunctionType getFuncType() {
        return funcType;
    }

    public void setFuncType(FunctionType funcType) {
        this.funcType = funcType;
    }

    public String getActiveKey() {
        return activeKey;
    }

    public void setActiveKey(String activeKey) {
        this.activeKey = activeKey;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getExt1() {
        return ext1;
    }

    public void setExt1(String ext1) {
        this.ext1 = ext1;
    }

    public String getExt2() {
        return ext2;
    }

    public void setExt2(String ext2) {
        this.ext2 = ext2;
    }

    public String getExt3() {
        return ext3;
    }

    public void setExt3(String ext3) {
        this.ext3 = ext3;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
    
    @Override
    public TreeBean mapping() {
        TreeBean bean = super.mapping();
        bean.setTitle(getLabel());
        return bean;
    }

}
